﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MVCCentral.Framework.Mvc.Fyneworks
{
    class Form
    {
        private List<string> tags = new List<string>();

        public Form(string formName)
        {
            this.FormName = formName;
        }

        public string FormName
        {
            get;
            private set;
        }

        public string OpenForm { get; set; }
        public string EndForm { get; set; }

        public string OpenDiv { get; set; }
        public string CloseDiv { get; set; }


        public IList<string> Tags
        {
            get { return tags; }
        }

        public string WriteForm()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append(OpenDiv);
            sb.Append(OpenForm);
            foreach (string tag in Tags)
            {
                sb.Append(tag);
            }
            sb.Append(EndForm);
            sb.Append(CloseDiv);

            return sb.ToString();
        }
    }
}
